﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>弹出保存对话框</title>
    
</head>
<body>
<button onclick="javascript:saveFile()">保存</button>
<script language="javascript" type="text/javascript">
    function saveFile(){
        let obj = window.frames("myIframe");                                 //找到窗体上的iframe
        obj.document.open();                                             //打开iframe
        obj.document.write (document.getElementById("content").value);  //获取文档的内容
        obj.document.close();                                           //关闭iframe
        obj.document.execCommand("SaveAs");                             //调用保存对话框
    }
</script>
</body>
</html>